<script setup lang="ts" name="PromotionArticle">
import { PromotionArticleProperty } from './config'
import { ArticleApi, ArticleType } from '@/api/mall/promotion/article'

/** 营销文章 */
// 定义属性
const props = defineProps<{ property: PromotionArticleProperty }>()
// 商品列表
const article = ref<ArticleType>()
watch(
  () => props.property.id,
  async () => {
    if (props.property.id) {
      article.value = await ArticleApi.detail(props.property.id)
    }
  },
  {
    immediate: true
  }
)
</script>

<template>
  <div class="min-h-30px" v-html="article?.content" />
</template>

<style scoped lang="scss"></style>
